package com.banch.cloud.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义负载均衡规则
 *
 * @author banch
 * @version 1.0
 * @date 2020/6/9
 */
@Configuration
public class MyRuleConfig {

    @Bean
    public IRule myRule() {
        // 随机
        return new RandomRule();
    }

}